#pragma strict
//////////////////////////////////////////////////////
///获取 层次信息
//////////////////////////////////////////////////////
import System.Text;
class HierarchyInfo extends EditorWindow{
	
	@MenuItem("Level4/Other/HierarchyInfo")
	static function Init(){
		EditorWindow.GetWindow.<HierarchyInfo>();
	}
	
	function OnGUI(){
		var obj:Transform = Selection.activeTransform;
		if(obj){
			var sb:StringBuilder = new StringBuilder();
			while(obj != null){
				sb.Insert(0,obj.name);
				sb.Insert(0,"/");
				obj = obj.parent;
			}
			EditorGUILayout.PrefixLabel("层次信息:");
			GUILayout.TextArea(sb.ToString());
			Debug.Log(sb.ToString());
		}
	}
}